<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main"/>
        <title>Issue List</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton" style="float:right">
                <a class="edit" href="${createLinkTo(dir:'admin')}">Admin</a>
            </span>
            <span class="menuButton">
                <g:link class="create" action="create">New Issue</g:link>
            </span>
        </div>
        <div class="body">
            <h1>Issue List</h1>
            <g:if test="${flash.message}">
                <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                            <g:sortableColumn property="id" title="Id"/>
                            <g:sortableColumn property="type" title="Type"/>
                            <g:sortableColumn property="status" title="Status"/>
                            <g:sortableColumn property="component" title="Component"/>
                            <g:sortableColumn property="submitter" title="Submitter"/>
                            <g:sortableColumn property="description" title="Description"/>
                            <g:sortableColumn property="bounty" title="Bounty"/>
                        </tr>
                    </thead>
                    <tbody>
                        <g:each in="${issueList}" status="i" var="issue">
                            <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                                <td>
                                    <g:link action="show" id="${issue.id}"
                                        >${issue.id?.encodeAsHTML()}</g:link>
                                </td>
                                <td>${issue.type?.encodeAsHTML()}</td>
                                <td>${issue.status?.encodeAsHTML()}</td>
                                <td>${issue.component?.encodeAsHTML()}</td>
                                <td>${issue.submitter?.encodeAsHTML()}</td>
                                <td>${issue.description?.encodeAsHTML()}</td>
                                <td>
                                    <g:repeat times="${issue.bounty}">
                                        <img src="${createLinkTo(dir:'images', file:'beer.gif')}" alt="${issue.bounty} beers"/>
                                    </g:repeat>
                                </td>
                            </tr>
                        </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${Issue.count()}"/>
            </div>
        </div>
    </body>
</html>
